<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Octonion Member Functions</title>
<link rel="stylesheet" href="../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Math Toolkit 4.2.1">
<link rel="up" href="../octonions.html" title="Chapter 18. Octonions">
<link rel="prev" href="oct_typedefs.html" title="Octonion Member Typedefs">
<link rel="next" href="oct_non_mem.html" title="Octonion Non-Member Operators">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="oct_typedefs.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../octonions.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="oct_non_mem.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="math_toolkit.oct_mem_fun"></a><a class="link" href="oct_mem_fun.html" title="Octonion Member Functions">Octonion Member Functions</a>
</h2></div></div></div>
<h4>
<a name="math_toolkit.oct_mem_fun.h0"></a>
      <span class="phrase"><a name="math_toolkit.oct_mem_fun.constructors"></a></span><a class="link" href="oct_mem_fun.html#math_toolkit.oct_mem_fun.constructors">Constructors</a>
    </h4>
<p>
      Template version:
    </p>
<pre class="programlisting"><span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_a</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">(),</span> <span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_b</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">(),</span> <span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_c</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">(),</span> <span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_d</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">(),</span> <span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_e</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">(),</span> <span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_f</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">(),</span> <span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_g</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">(),</span> <span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_h</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">());</span>
<span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z0</span><span class="special">,</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z1</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;(),</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z2</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;(),</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z3</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;());</span>
<span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">q0</span><span class="special">,</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">q1</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;());</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">X</span><span class="special">&gt;</span>
<span class="keyword">explicit</span> <span class="identifier">octonion</span><span class="special">(</span><span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">X</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a_recopier</span><span class="special">);</span>
</pre>
<p>
      Float specialization version:
    </p>
<pre class="programlisting"><span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(</span><span class="keyword">float</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_a</span> <span class="special">=</span> <span class="number">0.0f</span><span class="special">,</span> <span class="keyword">float</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_b</span> <span class="special">=</span> <span class="number">0.0f</span><span class="special">,</span> <span class="keyword">float</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_c</span> <span class="special">=</span> <span class="number">0.0f</span><span class="special">,</span> <span class="keyword">float</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_d</span> <span class="special">=</span> <span class="number">0.0f</span><span class="special">,</span> <span class="keyword">float</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_e</span> <span class="special">=</span> <span class="number">0.0f</span><span class="special">,</span> <span class="keyword">float</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_f</span> <span class="special">=</span> <span class="number">0.0f</span><span class="special">,</span> <span class="keyword">float</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_g</span> <span class="special">=</span> <span class="number">0.0f</span><span class="special">,</span> <span class="keyword">float</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_h</span> <span class="special">=</span> <span class="number">0.0f</span><span class="special">);</span>
<span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z0</span><span class="special">,</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z1</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;(),</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z2</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;(),</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z3</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;());</span>
<span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">q0</span><span class="special">,</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">q1</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;());</span>
<span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(</span><span class="identifier">octonion</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a_recopier</span><span class="special">);</span>
<span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(</span><span class="identifier">octonion</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a_recopier</span><span class="special">);</span>
</pre>
<p>
      Double specialization version:
    </p>
<pre class="programlisting"><span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(</span><span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_a</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">,</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_b</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">,</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_c</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">,</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_d</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">,</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_e</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">,</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_f</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">,</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_g</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">,</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_h</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">);</span>
<span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z0</span><span class="special">,</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z1</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;(),</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z2</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;(),</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z3</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;());</span>
<span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">q0</span><span class="special">,</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">q1</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;());</span>
<span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(</span><span class="identifier">octonion</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a_recopier</span><span class="special">);</span>
<span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(</span><span class="identifier">octonion</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a_recopier</span><span class="special">);</span>
</pre>
<p>
      Long double specialization version:
    </p>
<pre class="programlisting"><span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(</span><span class="keyword">long</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_a</span> <span class="special">=</span> <span class="number">0.0L</span><span class="special">,</span> <span class="keyword">long</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_b</span> <span class="special">=</span> <span class="number">0.0L</span><span class="special">,</span> <span class="keyword">long</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_c</span> <span class="special">=</span> <span class="number">0.0L</span><span class="special">,</span> <span class="keyword">long</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_d</span> <span class="special">=</span> <span class="number">0.0L</span><span class="special">,</span> <span class="keyword">long</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_e</span> <span class="special">=</span> <span class="number">0.0L</span><span class="special">,</span> <span class="keyword">long</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_f</span> <span class="special">=</span> <span class="number">0.0L</span><span class="special">,</span> <span class="keyword">long</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_g</span> <span class="special">=</span> <span class="number">0.0L</span><span class="special">,</span> <span class="keyword">long</span> <span class="keyword">double</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">requested_h</span> <span class="special">=</span> <span class="number">0.0L</span><span class="special">);</span>
<span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z0</span><span class="special">,</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z1</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;(),</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z2</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;(),</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">z3</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;());</span>
<span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">q0</span><span class="special">,</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">q1</span> <span class="special">=</span> <span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">&gt;());</span>
<span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(</span><span class="identifier">octonion</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a_recopier</span><span class="special">);</span>
<span class="keyword">explicit</span>  <span class="identifier">octonion</span><span class="special">(</span><span class="identifier">octonion</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a_recopier</span><span class="special">);</span>
</pre>
<p>
      A default constructor is provided for each form, which initializes each component
      to the default values for their type (i.e. zero for floating numbers). This
      constructor can also accept one to eight base type arguments. A constructor
      is also provided to build octonions from one to four complex numbers sharing
      the same base type, and another taking one or two quaternions sharing the same
      base type. The unspecialized template also sports a templarized copy constructor,
      while the specialized forms have copy constructors from the other two specializations,
      which are explicit when a risk of precision loss exists. For the unspecialized
      form, the base type's constructors must not throw.
    </p>
<p>
      Destructors and untemplated copy constructors (from the same type) are provided
      by the compiler. Converting copy constructors make use of a templated helper
      function in a "detail" subnamespace.
    </p>
<h4>
<a name="math_toolkit.oct_mem_fun.h1"></a>
      <span class="phrase"><a name="math_toolkit.oct_mem_fun.other_member_functions"></a></span><a class="link" href="oct_mem_fun.html#math_toolkit.oct_mem_fun.other_member_functions">Other
      member functions</a>
    </h4>
<h5>
<a name="math_toolkit.oct_mem_fun.h2"></a>
      <span class="phrase"><a name="math_toolkit.oct_mem_fun.real_and_unreal_parts"></a></span><a class="link" href="oct_mem_fun.html#math_toolkit.oct_mem_fun.real_and_unreal_parts">Real
      and Unreal Parts</a>
    </h5>
<pre class="programlisting"><span class="identifier">T</span>            <span class="identifier">real</span><span class="special">()</span>   <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span>  <span class="identifier">unreal</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
      Like complex number, octonions do have a meaningful notion of "real part",
      but unlike them there is no meaningful notion of "imaginary part".
      Instead there is an "unreal part" which itself is a octonion, and
      usually nothing simpler (as opposed to the complex number case). These are
      returned by the first two functions.
    </p>
<h5>
<a name="math_toolkit.oct_mem_fun.h3"></a>
      <span class="phrase"><a name="math_toolkit.oct_mem_fun.individual_real_components"></a></span><a class="link" href="oct_mem_fun.html#math_toolkit.oct_mem_fun.individual_real_components">Individual
      Real Components</a>
    </h5>
<pre class="programlisting"><span class="identifier">T</span>   <span class="identifier">R_component_1</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">T</span>   <span class="identifier">R_component_2</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">T</span>   <span class="identifier">R_component_3</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">T</span>   <span class="identifier">R_component_4</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">T</span>   <span class="identifier">R_component_5</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">T</span>   <span class="identifier">R_component_6</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">T</span>   <span class="identifier">R_component_7</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
<span class="identifier">T</span>   <span class="identifier">R_component_8</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
      A octonion having eight real components, these are returned by these eight
      functions. Hence real and R_component_1 return the same value.
    </p>
<h5>
<a name="math_toolkit.oct_mem_fun.h4"></a>
      <span class="phrase"><a name="math_toolkit.oct_mem_fun.individual_complex_components"></a></span><a class="link" href="oct_mem_fun.html#math_toolkit.oct_mem_fun.individual_complex_components">Individual
      Complex Components</a>
    </h5>
<pre class="programlisting"><span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">C_component_1</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">C_component_2</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">C_component_3</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">C_component_4</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
      A octonion likewise has four complex components. Actually, octonions are indeed
      a (left) vector field over the complexes, but beware, as for any octonion
      <span class="emphasis"><em><code class="literal">o = α + βi + γj + δk + εe' + ζi' + ηj' + θk'</code></em></span> we also have <span class="emphasis"><em><code class="literal">o
      = (α + βi) + (γ + δi)j + (ε + ζi)e' + (η - θi)j'</code></em></span> (note the <span class="bold"><strong>minus</strong></span> sign
      in the last factor). What the C_component_n functions return, however, are
      the complexes which could be used to build the octonion using the constructor,
      and <span class="bold"><strong>not</strong></span> the components of the octonion on
      the basis <span class="emphasis"><em><code class="literal">(1, j, e', j')</code></em></span>.
    </p>
<h5>
<a name="math_toolkit.oct_mem_fun.h5"></a>
      <span class="phrase"><a name="math_toolkit.oct_mem_fun.individual_quaternion_components"></a></span><a class="link" href="oct_mem_fun.html#math_toolkit.oct_mem_fun.individual_quaternion_components">Individual
      Quaternion Components</a>
    </h5>
<pre class="programlisting"><span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">H_component_1</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
<span class="special">::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">H_component_2</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
      Likewise, for any octonion <span class="emphasis"><em><code class="literal">o = α + βi + γj + δk + εe' + ζi' + ηj' + θk'</code></em></span> we
      also have <span class="emphasis"><em><code class="literal">o = (α + βi + γj + δk) + (ε + ζi + ηj - θj)e'</code></em></span>, though there is no
      meaningful vector-space-like structure based on the quaternions. What the H_component_n
      functions return are the quaternions which could be used to build the octonion
      using the constructor.
    </p>
<h4>
<a name="math_toolkit.oct_mem_fun.h6"></a>
      <span class="phrase"><a name="math_toolkit.oct_mem_fun.octonion_member_operators"></a></span><a class="link" href="oct_mem_fun.html#math_toolkit.oct_mem_fun.octonion_member_operators">Octonion
      Member Operators</a>
    </h4>
<h5>
<a name="math_toolkit.oct_mem_fun.h7"></a>
      <span class="phrase"><a name="math_toolkit.oct_mem_fun.assignment_operators"></a></span><a class="link" href="oct_mem_fun.html#math_toolkit.oct_mem_fun.assignment_operators">Assignment
      Operators</a>
    </h5>
<pre class="programlisting"><span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">=</span> <span class="special">(</span><span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a_affecter</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">X</span><span class="special">&gt;</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">=</span> <span class="special">(</span><span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">X</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a_affecter</span><span class="special">);</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">=</span> <span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a_affecter</span><span class="special">);</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">=</span> <span class="special">(::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a_affecter</span><span class="special">);</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">=</span> <span class="special">(::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">a_affecter</span><span class="special">);</span>
</pre>
<p>
      These perform the expected assignment, with type modification if necessary
      (for instance, assigning from a base type will set the real part to that value,
      and all other components to zero). For the unspecialized form, the base type's
      assignment operators must not throw.
    </p>
<h5>
<a name="math_toolkit.oct_mem_fun.h8"></a>
      <span class="phrase"><a name="math_toolkit.oct_mem_fun.other_member_operators"></a></span><a class="link" href="oct_mem_fun.html#math_toolkit.oct_mem_fun.other_member_operators">Other
      Member Operators</a>
    </h5>
<pre class="programlisting"><span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">+=</span> <span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">)</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">+=</span> <span class="special">(::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">+=</span> <span class="special">(::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">X</span><span class="special">&gt;</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">+=</span> <span class="special">(</span><span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">X</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
      These perform the mathematical operation <code class="computeroutput"><span class="special">(*</span><span class="keyword">this</span><span class="special">)+</span><span class="identifier">rhs</span></code>
      and store the result in <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
      The unspecialized form has exception guards, which the specialized forms do
      not, so as to insure exception safety. For the unspecialized form, the base
      type's assignment operators must not throw.
    </p>
<pre class="programlisting"><span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">-=</span> <span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">)</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">-=</span> <span class="special">(::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">-=</span> <span class="special">(::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">X</span><span class="special">&gt;</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">-=</span> <span class="special">(</span><span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">X</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
      These perform the mathematical operation <code class="computeroutput"><span class="special">(*</span><span class="keyword">this</span><span class="special">)-</span><span class="identifier">rhs</span></code>
      and store the result in <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
      The unspecialized form has exception guards, which the specialized forms do
      not, so as to insure exception safety. For the unspecialized form, the base
      type's assignment operators must not throw.
    </p>
<pre class="programlisting"><span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">*=</span> <span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">)</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">*=</span> <span class="special">(::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">*=</span> <span class="special">(::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">X</span><span class="special">&gt;</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">*=</span> <span class="special">(</span><span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">X</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
      These perform the mathematical operation <code class="computeroutput"><span class="special">(*</span><span class="keyword">this</span><span class="special">)*</span><span class="identifier">rhs</span></code>
      in this order (order is important as multiplication is not commutative for
      octonions) and store the result in <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>. The unspecialized form has exception guards,
      which the specialized forms do not, so as to insure exception safety. For the
      unspecialized form, the base type's assignment operators must not throw. Also,
      for clarity's sake, you should always group the factors in a multiplication
      by groups of two, as the multiplication is not even associative on the octonions
      (though there are of course cases where this does not matter, it usually does).
    </p>
<pre class="programlisting"><span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">/=</span> <span class="special">(</span><span class="identifier">T</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">)</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">/=</span> <span class="special">(::</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">/=</span> <span class="special">(::</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">quaternion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">X</span><span class="special">&gt;</span>
<span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&amp;</span> <span class="keyword">operator</span> <span class="special">/=</span> <span class="special">(</span><span class="identifier">octonion</span><span class="special">&lt;</span><span class="identifier">X</span><span class="special">&gt;</span> <span class="keyword">const</span> <span class="special">&amp;</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
      These perform the mathematical operation <code class="computeroutput"><span class="special">(*</span><span class="keyword">this</span><span class="special">)*</span><span class="identifier">inverse_of</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">)</span></code>
      in this order (order is important as multiplication is not commutative for
      octonions) and store the result in <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>. The unspecialized form has exception guards,
      which the specialized forms do not, so as to insure exception safety. For the
      unspecialized form, the base type's assignment operators must not throw. As
      for the multiplication, remember to group any two factors using parenthesis.
    </p>
</div>
<div class="copyright-footer">Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
      Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
      Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
      Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
      Walker and Xiaogang Zhang<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="oct_typedefs.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../octonions.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="oct_non_mem.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
